This directory includes data and code for replicating the findings in "The Effect of Mass Shootings on Voter Turnout in the United States." The directory includes code, raw data, and intermediate datafiles.

Scripts in 02_process_voter_files, and 03_rdit_code/01_distance_btwn_bgs_killings.R will not run, as the raw data cannot be provided. All other scripts run.


________________________________________
CODE 

00_initialize.R: Read in libraries needed. Set up some functions.

02_process_voter_files: These scripts create block group counts of ballots cast in the 2014--2020 elections. The data to run these scripts is NOT INCLUDED. The output of these scripts, however, is included.

03_rdit_code/01_distance_btwn_bgs_killings.R: Read GVA data (raw data not included). Determine how far every 2016, 2020 block group is from each mass shooting.

03_rdit_code/02_contact_mrp.R: Estimate share of CES respondents in each county who report being contacted by a campaign, 2016, 2020

03_rdit_code/03_homicides.R: Download and read homicide rates by county, 2016, 2020

03_rdit_code/04_bg_partisanship.R: Determine the home precinct of each block group in the 2016, 2020 election. Assign Democratic vote share. This requires separately downloading VEST data and adding to the raw_data folder: https://dataverse.harvard.edu/dataverse/electionscience

03_rdit_code/05_primary_rdit_models.R: Finish processing data used in analysis. Run primary block group RDiT models. Create some diagnostic figures. Create RDiT tables (like the balance one, diagnostics, etc).

03_rdit_code/06_effect_by_bg_partisanship.R: Test whether mass shootings have a bigger effect in more-Dem or less-Dem block groups

03_rdit_code/07_results_process.R: Identify how far each precinct is from each mass shooting. Calculate precinct Dem vote share

03_rdit_code/08_rdit_dem.R: Create RDiT plot for precinct-level model.

03_rdit_code/09_robustness_rdit_models.R: Various and sundry RDiT robustness checks

03_rdit_code/10_three_victims.R: Re-estimate the RDiT under different definitions of mass shootings.

03_rdit_code/11_shooting_characteristics.R: Test characteristics of shootings themselves.

04_ca.R: California analysis.

05_map.R: Create maps
